package com.study.test;

import com.study.bean.Person;
import com.study.bean.Son;
import com.study.config.MainConfigOfPropertyValue;
import com.study.config.Test1;
import org.junit.Test;
import org.omg.CORBA.PERSIST_STORE;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author wuwenbo
 * @date 2020/4/6 - 22:08
 */
public class IOCTest_PropertyValue {
    ApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfPropertyValue.class);
    @Test
    public void test_PropertyValue() {
        printBeans(applicationContext);
        System.out.println("=========================");
        Person person = (Person) applicationContext.getBean("person");
        System.out.println(person);
    }

    private void printBeans(ApplicationContext applicationContext) {
        for (String name : applicationContext.getBeanDefinitionNames()) {
            System.out.println(name);
        }
    }
}
